//
//  ZCSearchCell.m
//  zctx
//
//  Created by 郭亚京 on 15/10/17.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "ZCSearchCell.h"

@implementation ZCSearchCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self.contentView addSubview:self.iconImgView];
        [self.iconImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView.centerY);
            make.left.mas_equalTo(@(20));
            make.height.mas_equalTo(@(30));
            make.width.mas_equalTo(@(30));
        }];
        [self.contentView addSubview:self.infoLable];
        [self.infoLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView.centerY);
            make.right.equalTo(self.contentView.right).with.offset(-20);
            make.height.mas_equalTo(@(40));
//            make.left.equalTo(self.titleLable.right).with.offset(20);
        }];
        
        [self.contentView addSubview:self.titleLable];
        [self.titleLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView.centerY);
            make.left.equalTo(self.iconImgView.right).with.offset(15);
            make.right.equalTo(self.infoLable.left).with.offset(-20);
            make.height.mas_equalTo(@(40));
        
        }];
        
        

    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    
}

-(UILabel *)titleLable{
    if (!_titleLable) {
        _titleLable = [[UILabel alloc]init];
        _titleLable.font = [UIFont systemFontOfSize:15];
        _titleLable.numberOfLines = 0;
        _titleLable.textAlignment = NSTextAlignmentLeft;
        _titleLable.textColor = [UIColor colorWithHexString:@"#666666"];
    }
    return _titleLable;
}

-(UILabel *)infoLable{
    if (!_infoLable) {
        _infoLable = [[UILabel alloc]init];
        _infoLable.font = [UIFont systemFontOfSize:14];
        _infoLable.numberOfLines = 0;
        _infoLable.textAlignment = NSTextAlignmentRight;
    }
    return _infoLable;
}

-(UIImageView *)iconImgView{
    if (!_iconImgView) {
        _iconImgView = [[UIImageView alloc] init];
    }
    return _iconImgView;
    
}

@end
